{include file="common/business/header" /}
<style>
        .loging_outerbox{
            background-color: #7d6ffa;
            padding: 70px 0 70px 0;
        }
    .float-e-margins{
        background: url(__WWW_STATIC__/www/index/img/log-bc.png);
        height: 590px;
        background-position:center;
        background-repeat: no-repeat;
        background-color: transparent;
        overflow: hidden;
    }
    .form-horizontal{
        width: 1000px;
        margin:0 auto;
        margin-top: 120px;
        padding-left: 560px;
        box-sizing: border-box;
    }
    .log_list{
        width: 350px;
        height: 40px;
        position: relative;
        line-height: 40px;
        margin-bottom: 30px;
    }
    .log_list>input{
        background-color: #f9f9f9;
        border:none;
        width: 100%;
        text-indent: 50px;
        height: 40px;line-height: 40px;
    }
    .log_list>svg{
        position: absolute;
        left: 20px;
        top: 7px;
    }
    #forgetBtn{
        height: 40px;
        width: 350px;
        cursor: pointer;
        line-height: 40px;
        text-align: center;
        font-size: 16px;
        color: #fff;
        background-color: #0790ef;
        border:none;
        border-radius: 3px;
        display: block;
        margin-bottom: 20px;
        padding: 0;
    }
    #cpt{
        box-sizing: border-box;
        border: 1px solid #dadada;
    }
    </style>

        <div class="loging_outerbox">

            <div class="float-e-margins">
                <div >
                            <form class="form-horizontal">
                                    <h2 style="margin-bottom:25px;font-size:18px;text-align:center;width:350px;">忘记密码</h2>
                            {:token()}
                                <div class="log_list">
                                        <svg 
                                        xmlns="http://www.w3.org/2000/svg"
                                        xmlns:xlink="http://www.w3.org/1999/xlink"
                                        width="16px" height="24px">
                                       <image  x="0px" y="0px" width="16px" height="24px"  xlink:href="data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAYCAQAAABZqbWHAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfhCBUUEwei31F2AAABIUlEQVQoz5WQvUoDURCFvzO7+TEhWmuj7+AriIhPYZ/WN/ABLBV8CkvBIvsAgqDY2FoEsYlKsgvZOxZulr2bWHiKCzPnm8uZUTbiilMSlsRKkCYaK7vjmD/k6EmZA898YS0z0LVDJ8WRn+khtgNGf1R8OkYAut6yxYC061B93AGPpocYoUcNVJFW9gCrB9I4NSRsYQRU9awN9KtYbAJANNNsANb1X8BRHW8DIKDAI8Ri2liyqNA1wKq3jBBbHcAaYMmCgPy3EvDRDlaS41MBKTkDu+SdBDD2MN4IRgjzPihXNmO7MTyl8H3VKzMzkoZ9y64O0huvl8aMYeP2ryA6j43OKOWeo7o8V1l+5xeN3V+U7ejaTzCWQI8hkDMHEsTExj8gbViZHi23AwAAAABJRU5ErkJggg==" />
                                       </svg>
                                    <input id="tel" type="tel" placeholder="请输入手机号"  value=""  class="form-control" autocomplete="off">
                                </div>
                                <div class="log_list">
                                    <svg
                                            xmlns="http://www.w3.org/2000/svg"
                                            xmlns:xlink="http://www.w3.org/1999/xlink"
                                            style="width:20px;height:24px;">
                                        <image  x="0px" y="0px" width="20px" height="24px"  xlink:href="data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAYCAQAAABQQhX9AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfhCBUUEx7GtPm2AAABj0lEQVQoz42TPUiVYRTHf//z3tdLjUFNghS1hFCSS0tLDimNiQ5FtNgSDjU0RFsUtLjk0qRtiriFKC2XayQFfUFtUXHTzegDwvR9ntPgva8v97WrZ3rOc37P+Z8PHtVxHAAhIsBTvnMFDIDYjGx7LasyyhuGuEydi6gYUv24V7zKIU7QrwE/Woh91JLexs+sK+ival/oYW9bMdJ9YJAYf/YFbljnuOcn6wTZZDKxN/iTEW5wuJWz8h/B9zaYrGWv6VM5Y+ttJJ05cCqshVfq25l5DuoRZ1kARxM2ugWzsb+okkuHH9UVHwpT7nYzY+tWMqxCz6DaJ45tC3bN+XAEEjiZfWgr+7nJvVnD5qXwLJphymZK/WXmq4Vyz/tLKQ7E3hLYqFDj3I5vZ7IXOrjLcJe03B0a7UtTO7aubrNvulO8UxmDMd+wiN3XLJ3snuabX0EjPN6dcbitu4XN6HpylUYJe1e5oIdtK/Qn3msP+NXy49dkPD3NYl77MuA4IpDiR8I1xvx3OhmnbdPI8jX+A8gjgqu9YYRXAAAAAElFTkSuQmCC" />
                                    </svg>
                                    <input type="text" name="captcha" id="captchaCode" style="width:180px;float:left" placeholder="输入验证码" class="form-control" autocomplete="off">
                                    <div id="captchas" style="float:right;width:150px">
                                        <img id="capt" src="{:url('index/captcha')}" width="150" height="40" >
                                    </div>
                                </div>
                                <div class="log_list">
                                        <svg 
                                        xmlns="http://www.w3.org/2000/svg"
                                        xmlns:xlink="http://www.w3.org/1999/xlink"
                                        width="16px" height="22px">
                                       <image  x="0px" y="0px" width="16px" height="22px"  xlink:href="data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAWCAQAAABjo9T3AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfhCBUUExFWC+QnAAABQUlEQVQoz32OPS+kYRiFr3N7fCyrEJYVFLIRBc0moqE0FaVfoBHT0ewP2NZHv/9ge0I0jMS2JFpEppKdRMFIxnjf51bM4DWGq7ufc85zjo4AiNgAvzzHONcc+pZODAdANYNPse89goQAjhZsp2Ywx6GTXXr0l5/0M8ZvwXYcAYCWJYQv+6JOyXFNhRsd6BvTbuwBmBAsgNbFC39Ai+i5QkwIP/O66ngRGNKwEBaJHXQB989xoZQE+AoQDE9IgMfXBt3pB3hRGKGN6mN8UM1v9YpIEVytboQ46RsMAtuUaSeLxStfVaHkfaI5DqVA70cyCPqM8rtUlrK9OS+YZYbzN0OyWcvbcde/LyuxuUHEXEqVylz2WxVu6X4943dSK2X0u9Cw+3/jykZDntjwUkho4WNS84TPSEKYTzcZpZktcGlrT4zDbiYDYavQAAAAAElFTkSuQmCC" />
                                       </svg>
                                                <input type="number" class="form-control" value=""  placeholder="请输入验证码" id="verify_code" autocomplete="off" style="float:left;width:180px">
                                                <input id="btnSendCode" type="button" value="获取手机验证码" onClick="sendMessage()" style="border:none;width:150px;float:right;text-indent:0;color:#999" />
                                        <span class="help-block m-b-none hide verify_code_error danger_red">手机验证码输入错误</span>
                                </div>
                                <div class="log_list">
                                        <svg 
                                        xmlns="http://www.w3.org/2000/svg"
                                        xmlns:xlink="http://www.w3.org/1999/xlink"
                                        width="20px" height="24px">
                                       <image  x="0px" y="0px" width="20px" height="24px"  xlink:href="data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAYCAQAAABQQhX9AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfhCBUUEx7GtPm2AAABj0lEQVQoz42TPUiVYRTHf//z3tdLjUFNghS1hFCSS0tLDimNiQ5FtNgSDjU0RFsUtLjk0qRtiriFKC2XayQFfUFtUXHTzegDwvR9ntPgva8v97WrZ3rOc37P+Z8PHtVxHAAhIsBTvnMFDIDYjGx7LasyyhuGuEydi6gYUv24V7zKIU7QrwE/Woh91JLexs+sK+ival/oYW9bMdJ9YJAYf/YFbljnuOcn6wTZZDKxN/iTEW5wuJWz8h/B9zaYrGWv6VM5Y+ttJJ05cCqshVfq25l5DuoRZ1kARxM2ugWzsb+okkuHH9UVHwpT7nYzY+tWMqxCz6DaJ45tC3bN+XAEEjiZfWgr+7nJvVnD5qXwLJphymZK/WXmq4Vyz/tLKQ7E3hLYqFDj3I5vZ7IXOrjLcJe03B0a7UtTO7aubrNvulO8UxmDMd+wiN3XLJ3snuabX0EjPN6dcbitu4XN6HpylUYJe1e5oIdtK/Qn3msP+NXy49dkPD3NYl77MuA4IpDiR8I1xvx3OhmnbdPI8jX+A8gjgqu9YYRXAAAAAElFTkSuQmCC" />
                                       </svg>
                                        <input placeholder="请输入新密码" type="password" value="" class="form-control" id="new_pw" autocomplete="off">
                                        <!-- <span class="help-block m-b-none hide verify_code_error danger_red">手机验证码输入错误</span> -->
                                </div>
                                <button id="forgetBtn" class="btn btn-success" type="button">确定</button>
                            </form>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
{include file="common/business/footer" /}

</div>
<script>
	
</script>


<script src="__WWW_STATIC__/www/index/js/bootstrap.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/jquery.metisMenu.js"></script>
<script src="__WWW_STATIC__/www/index/js/jquery.slimscroll.min.js"></script>

<script src="__WWW_STATIC__/www/index/js/momentjs.js"></script>

<!-- Flot -->
<script src="__WWW_STATIC__/www/index/js/jquery.flot.js"></script>
<!-- <script src="__WWW_STATIC__/js/jquery.flot.tooltip.min.js"></script> -->
<script src="__WWW_STATIC__/www/index/js/jquery.flot.resize.js"></script>
<script src="__WWW_STATIC__/www/index/js/jquery.flot.pie.js"></script>

<!-- Data Tables -->
<script src="__WWW_STATIC__/www/index/js/jquery.dataTables.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/dataTables.bootstrap.js"></script>
<script src="__WWW_STATIC__/www/index/js/dataTables.responsive.js"></script>

<script src="__WWW_STATIC__/www/index/js/jquery.twbsPagination.min.js"></script>

<!-- Chosen -->
<script src="__WWW_STATIC__/www/index/js/select2.full.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/zh-CN.js"></script>
<!-- Data picker -->
<script src="__WWW_STATIC__/www/index/js/daterangepicker.js"></script>
<script src="__WWW_STATIC__/www/index/js/bootstrap-datetimepicker.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/bootstrap-datetimepicker.zh-CN.js"></script>

<!-- Nestable List -->
<!-- <script src="__WWW_STATIC__/js/plugins/nestable/jquery.nestable.js"></script> -->

<!-- Custom and plugin javascript -->
<script src="__WWW_STATIC__/www/index/js/inspinia.js"></script>
<script src="__WWW_STATIC__/www/index/js/pace.min.js"></script>

<!-- ChartJS-->
<script src="__WWW_STATIC__/www/index/js/Chart.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/chartjs-demo.js"></script>

<script src="__WWW_STATIC__/www/index/js/icheck.min.js"></script>

<script src="__WWW_STATIC__/www/index/js/art-template.js"></script>
<script src="__WWW_STATIC__/www/index/js/jquery.md5.js"></script>
<script src="__WWW_STATIC__/www/index/js/bootbox.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/notify.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/laravel-sms.js"></script>

<script src="__WWW_STATIC__/www/index/js/ZeroClipboard.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/jquery.gridly.js"></script>
<script type="text/javascript">
 $(".span:contains('首页')").css("color","#4990E2").siblings().css("display","block")

 $('#capt').click(function () {
     $('#capt').attr('src', "{:url('index/captcha', '', false)}/#" + Math.random());
 });

var InterValObj; //timer变量，控制时间
var count = 60; //间隔函数，1秒执行
var curCount;//当前剩余秒数
var code = ""; //验证码
var codeLength = 6;//验证码长度
function sendMessage() {
    var phone = $("#tel").val();
    var captcha = $("input[name='captcha']").val();
    if (!captcha) {
        layer.msg('请输入图片验证码');
    } else {
        curCount = count;

        $.ajax({
            type: "get",
            dataType: "json",
            url: "{:url('index/isRegister', '', false)}/phone/" + phone,
            success: function (data) {
                if (data.status == 1) {
                    layer.msg(data.msg);
                } else {
                    $.ajax({
                        type: "post",
                        dataType: "json",
                        url: "{:url('index/sendMessage', '', false)}",
                        data:{'phone':phone,'captcha':captcha},
                        error: function (XMLHttpRequest, textStatus, errorThrown) {},
                        success: function (data) {
                            if (data.status == 0) {
                                InterValObj = window.setInterval(SetRemainTime, 1000);
                                $("#btnSendCode").attr("disabled", "true");
                                $("#btnSendCode").val(+curCount + "秒后再获取");
                                layer.msg(data.msg);
                            }
                            if (data.status == 1) {
                                InterValObj = window.setInterval(SetRemainTime, 1000);
                                $("#btnSendCode").attr("disabled", "true");
                                $("#btnSendCode").val(+curCount + "秒后再获取");
                            }
                            if (data.status == 2){
                                layer.msg(data.msg);
                            }
                        }
                    });
                }
            }
        });
    }
}
//timer处理函数
function SetRemainTime() {
    if (curCount == 0) {                
        window.clearInterval(InterValObj);//停止计时器
        $("#btnSendCode").removeAttr("disabled");//启用按钮
        $("#btnSendCode").val("重新获取验证码");
        code = ""; //清除验证码。如果不清除，过时间后，输入收到的验证码依然有效    
    }
    else {
        curCount--;
        $("#btnSendCode").val( + curCount + "秒后再获取");
    }
}
</script>
<script>

    var fakeId = new Date().getTime();

    function getFakeId()
    {
        fakeId++;
        return fakeId;
    }

    var path = "__WWW_STATIC__";
    function url(str)
    {
        return path + "/" + str;
    }

    var languageSetting = {
        "sProcessing": "处理中...",
        "sLengthMenu": "显示 _MENU_ 项结果",
        "sZeroRecords": "没有匹配结果",
        "sInfo": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
        "sInfoEmpty": "显示第 0 至 0 项结果，共 0 项",
        "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
        "sInfoPostFix": "",
        "sSearch": "搜索: ",
        "sUrl": "",
        "sEmptyTable": "表中数据为空",
        "sLoadingRecords": "载入中...",
        "sInfoThousands": ",",
        "oPaginate": {
            "sFirst": "首页",
            "sPrevious": "上页",
            "sNext": "下页",
            "sLast": "末页"
        },
        "oAria": {
            "sSortAscending": ": 以升序排列此列",
            "sSortDescending": ": 以降序排列此列"
        }
    };

    var dateOptions = {
        format: "yyyy-mm-dd",
        autoclose: true,
        todayBtn: true,
        minView: 2,
        language: "zh-CN"
    };

    var docHeight = $("body").height();
    var winHeight = $(window).height();
    if(docHeight < winHeight){
        $("#page-wrapper").css("min-height", winHeight - 40);
    }
    $(".footer").removeClass("hide");

    function showAlert(message, callback){
        bootbox.alert({
            message: message,
            size: 'small',
            backdrop: true,
            buttons: {
                ok: {
                    label: '确定',
                    className: 'btn-success'
                }
            },
            callback: callback
        });
    }

    function showAlertWithCall(message, callback){
        bootbox.alert({
            message: message,
            size: 'small',
            backdrop: true,
            buttons: {
                ok: {
                    label: '确定',
                    className: 'btn-success'
                }
            },
            callback: function(){
                callback();
            }
        });
    }

    function getUrlParam(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]); return null;
    }

    toastr.options = {
        "closeButton": false,
        "debug": false,
        "newestOnTop": false,
        "progressBar": false,
        "positionClass": "toast-top-center",
        "preventDuplicates": false,
        "onclick": null,
        "showDuration": "500",
        "hideDuration": "10",
        "timeOut": "3000",
        "extendedTimeOut": "10",
        "showEasing": "linear",
        "hideEasing": "linear",
        "showMethod": "slideDown",
        "hideMethod": "slideUp"
    };

    function notify(content, type)
    {
        toastr.remove();
        switch(type){
            case "error":
                toastr.error(content);
                break;
            default:
                toastr.error(content);
                break;
        }
    }

    function showConfirm(message, next){
        bootbox.confirm({
            message: message,
            size: 'small',
            backdrop: true,
            buttons: {
                confirm: {
                    label: '确定',
                    className: 'btn-white'
                },
                cancel: {
                    label: "取消",
                    className: "btn-success"
                }
            },
            callback: function(result) {
                next(result);
            }
        });
    }

    function showConfirmWithOver(message, next){
        bootbox.confirm({
            message: message,
            size: 'small',
            backdrop: true,
            buttons: {
                confirm: {
                    label: '确定',
                    className: 'btn-success'
                },
                cancel: {
                    label: "取消",
                    className: "btn-white"
                }
            },
            callback: function(result) {
                next(result);
            }
        });
    }

    $("input[type=number]").on("keyup keydown keypress input", function(){
        var val = $(this).val();
        if( !IsNum(val) ){
            $(this).val(1);
            notify("请输入数字");
        }
    });

    function IsNum(s)
    {
        if(s!=null){
            var r,re;
            re = /\d*/i;
            r = s.match(re);
            return (r==s)?true:false;
        }
        return false;
    }

    $("#logout").on("click", function(){
        $.post(url("logout"), {}, function(data){
            window.location.href = url("login");
        });
    });

    var hre = window.location.href
    if( hre == url("regist/shop_info") || hre == url("regist/qyzz") || hre == url("regist/brand_info") || hre == url("regist/result")  ){
        $("div[name=top_bar]").css("display", "none");
        $("#consult_btn").css("display", "block");
    }

    $("#consult_btn").click(function(){
        $("#zhichiBtnBox").trigger("click");
    });

    $("input[type=tel]").attr("autocomplete", "off");
    $("input[type=password]").attr("autocomplete", "off");
    $("input[type=text]").attr("autocomplete", "off");
    if( !localStorage.getItem("first") ){
        $("#first_suggest").css("display", "block");
    }
    $("#cancel_first_suggest").click(function(){
        $("#first_suggest").css("display", "none");
        localStorage.setItem("first", true);
    });
</script>
<script>

    var rules = {
        "telephone": /^1((3[0-9]|4[57]|5[0-35-9]|7[0678]|8[0-9])\d{8}$)/,
        "password": /[\w\d]{8,}/,
    };

    $("#forgetBtn").on("click", doForget);

    function doForget(){
        var tel = $("#tel").val().trim();
        var pw = $("#new_pw").val().trim();
        var code = $("#verify_code").val().trim();
        if(tel == ""){
            layer.msg("请输入手机号");
            return;
        }
        if(tel.length != 11 || tel[0] != '1'){
            layer.msg("请输入正确手机号");
            return;
        }
        if(pw == ""){
            layer.msg("请输入新密码");
            return;
        }
        if(code == ""){
            layer.msg("输入验证码错误");
            return;
        }
        $.post("{:url('index/updatePwd')}", {
            "tel": tel,
            "pw":pw,
            "code" : code
        }, function(data){
            if(data.status==1){
                setTimeout(function(){
                     layer.msg(data.msg);  
                     window.location.href = "{:url('index/login')}"; 
                },1000);
            }else{
                layer.msg(data.msg);
            }
        });
    }

    $("#btn_cover").on("click", function(){
        if(!rules["telephone"].test($("#tel").val())){
            $(".tel_error").removeClass("hide");
            notify("手机号码输入错误");
        }else{
            $(".tel_error").addClass("hide");
            $("#verify_modal").modal("show");
            $("#code").val("");
        }
    });
    $("#comfirm_btn").click(function(){
        var code = $("#code").val();
        if(code.length != 5){
            hasError = true;
            $(".code_error").removeClass("hide");
        }else{
            $(".code_error").addClass("hide");
            $.post(url("check_verify_code"), {code: code}, function(data){
                if(data.success){
                    $("#verify_modal").modal("hide");
                    $(".tel_error").addClass("hide");
                    $("#send_verify_code").click();
                }else{
                    notify(data.err_msg);
                    refreshCaptcha();
                }
            });
        }
    });

    $("#send_verify_code").sms({
        interval: 60,
        requestData: {
            mobile: function(){
                return $("#tel").val();
            },
            code: function(){
                return $("#code").val();
            }
        }
    });

    $("#captcha").on("click", refreshCaptcha);

function refreshCaptcha()
{
    $("#captcha img").attr("src", url("captcha" + "?t=" + moment().unix()));
}

</script><div class="modal inmodal fade" id="verify_modal" tabindex="-1" role="dialog" aria-hidden="false" style="display: none;"><div class="modal-backdrop fade"></div>
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title"></h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label class="    control-label">验证码</label>
                    <div class="col-lg-9 col-md-9 col-xs-9">
                        <input type="text" class="form-control" style="width:150px;" id="code">
                        <div class="col-lg-12 col-md-12 col-xs-12 no-padding" style="cursor:pointer;" id="captcha">
                            <img src="" width="150" height="40" style="border: 1px solid #e5e6e7;margin-top:10px;margin-bottom: 10px;"> <a href="javascript:void(0);">换一张</a>
                        </div>
                        <span class="help-block m-b-none danger_red code_error hide">验证码输入错误</span>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal" id="cancelBtn">取消</button>
                <button type="button" class="btn btn-success btn-md" id="comfirm_btn">确定</button>
            </div>
        </div>
    </div>
</div>
<script>
function getCookie(name)
{
var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
if(arr=document.cookie.match(reg))
return unescape(arr[2]);
else
return null;
}
$(document).ready(function(){
   $("#verify_code").val("");
   $("#new_pw").val("");
    var arr =getCookie('phone');
 
   if(arr!=null||arr!="") 
   {
   $("#tel").val(arr);
   }
  
});
</script>





</body></html>